package entity;

import java.time.LocalDate;
import java.util.Objects;

// 第二行注释
// 项目的类
public class Project {
	// 项目编号（唯一）
	private int id;
	// 项目名
	private String name;
	// 语言
	private String language;
	// 是否上线
	private boolean onLine;
	// 启动时间
	private LocalDate start;
	// 负责人
	private String teamLeader;
	
	public Project() {
		super();
	}
	public Project(int id, String name, String language, boolean onLine, LocalDate start, String teamLeader) {
		super();
		this.id = id;
		this.name = name;
		this.language = language;
		this.onLine = onLine;
		this.start = start;
		this.teamLeader = teamLeader;
	}
	
	// 重写equals和hashCode
	@Override
	public int hashCode() {
		return Objects.hash(id);
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Project other = (Project) obj;
		return id == other.id;
	}
	
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getLanguage() {
		return language;
	}
	public void setLanguage(String language) {
		this.language = language;
	}
	public boolean isOnLine() {
		return onLine;
	}
	public void setOnLine(boolean onLine) {
		this.onLine = onLine;
	}
	public LocalDate getStart() {
		return start;
	}
	public void setStart(LocalDate start) {
		this.start = start;
	}
	public String getTeamLeader() {
		return teamLeader;
	}
	public void setTeamLeader(String teamLeader) {
		this.teamLeader = teamLeader;
	}
	
	@Override
	public String toString() {
		return "Project [id=" + id + ", name=" + name + ", language=" + language + ", onLine=" + onLine + ", start="
				+ start + ", teamLeader=" + teamLeader + "]";
	}
}
